all: pkasm.exe	
SVN_REV=$(shell svnversion -n .)

version.h:
	echo "#ifndef VERSION_H" > version.h
	echo "#define VERSION_H" >> version.h
	echo '    static const char* SVN_REVISION = "$(SVN_REV)";' >> version.h
	echo "#endif" >> version.h

pkasm_parse.cpp:
	bison -vd -o pkasm_parse.cpp pkasm.y

pkasm_lex.cpp: pkasm.y pkasm_parse.cpp pkasm_parse.hpp debug.h
	flex  -vd -o pkasm_lex.cpp pkasm.l
	
pkasm.exe: version.h pkasm.y pkasm.l pkasm_lex.cpp pkasm_parse.cpp instruction.cpp instruction.h util.h main.cpp debug.h
	g++ -g -DYYDEBUG instruction.cpp util.cpp main.cpp -o pkasm.exe

clean: 
	rm -rf *.o pkasm_lex.cpp pkasm_parse.cpp pkasm_parse.hpp pkasm.exe version.h	
	
